#include "Render.h"
#include "VertexBuffer.h"
VertexBuffer::VertexBuffer(const void *data, unsigned int size, GLenum usage)
{
	glGenBuffers(1,&m_id);
	glBindBuffer(GL_ARRAY_BUFFER,m_id);
	glBufferData(GL_ARRAY_BUFFER,size,data,usage);
}


void VertexBuffer::bind() const
{
	glBindBuffer(GL_ARRAY_BUFFER,m_id);
}

void VertexBuffer::unbind() const
{
	glBindBuffer(GL_ARRAY_BUFFER,0);
}

VertexBuffer::~VertexBuffer()
{
	glDeleteBuffers(1,&m_id);
}


